<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:p="http://primefaces.org/ui"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	>

	<ui:composition template="/meringerTemplate.xhtml">

		<ui:define name="content">
		     <h:form id="form">  
  				<p:messages id="msg" autoUpdate="true" />
			    <p:dataTable var="car" value="#{carBean.cars}" rowKey="#{car.carModel.name}" paginator="true" rows="1"  
			               id="carsTable">  
			  					
			  				
							        
				     <p:column style="background-color: green;" rendered="#{userBean.currentUser.mainCar.carID == car.car.carID}" headerText="Model" id="model">  
				        
				        <span>DEFAULT CAR</span>
				        <img src="#{car.carModel.imgPath}" />
				        <p:commandButton id = "btn" value="Sell" action="#{carBean.cellCar(car.car)}">
    					</p:commandButton>
			            #{car.carModel.name }
			       	 </p:column> 
			       	  <p:column rendered="#{!(userBean.currentUser.mainCar.carID == car.car.carID)}" headerText="Model" id="model2">  
				        
				        
				        <img src="#{car.carModel.imgPath}" />
				        
			            #{car.carModel.name }
			       	 </p:column> 
			  		<p:column headerText="Handling cur/max" id="handling">  
	
			            #{car.car.handling} / #{car.carModel.maxHandling}
			        </p:column>  
			        <p:column headerText="Acceleration cur/max" id="acceleration">  
			            #{car.car.acceleration} / #{car.carModel.maxAcceleration}
			        </p:column>  
			        <p:column headerText="Top speed cur/max" id="top-speed">  
			            #{car.car.topSpeed} / #{car.carModel.maxTopSpeed}
			        </p:column>  
			  		
			      
			  
			    </p:dataTable>  
			  
			 
			    
				
			</h:form>  
		</ui:define>
	</ui:composition>

</html>
